package top.ninwoo.edgecenter.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.ninwoo.edgecenter.service.LogicTopoService;

import java.util.List;

@RestController
@RequestMapping("/dockerData")
public class TransferTopoController {

    @Autowired
    private LogicTopoService logicTopoService;

    @GetMapping("/getIPlist")
    public List<String> getIPlist(@RequestParam(name = "clusterId")long clusterId) {
        //System.out.println("已返回IPlist");
        return logicTopoService.getIPlist(clusterId);
    }

    //需下发逻辑拓扑后才能获得
    @GetMapping("/getTopo")
    public int[][] getTopo(@RequestParam(name = "clusterId")long clusterId) {
        //System.out.println("已返回topo");
        return logicTopoService.getTopo(clusterId);
    }

}
